package com.example.a2205douyin.adapter;

import android.widget.ImageView;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.example.a2205douyin.R;
import com.example.a2205douyin.entity.GiftEntity;

import java.util.List;

public class GiftAdapter extends BaseQuickAdapter<GiftEntity.DataBean, BaseViewHolder> {
    public GiftAdapter(int layoutResId, @Nullable List<GiftEntity.DataBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(@NonNull BaseViewHolder holder, GiftEntity.DataBean bean) {
        holder.setText(R.id.tv_price,bean.getPrice()+"元");
        ImageView iv = holder.findView(R.id.iv_gift);
        Glide.with(getContext()).load(bean.getGiftpath()).into(iv);
    }
}
